package ua.com.globallogic.training.task2;

public class PortableDevice extends Device {
	public static final double DEFAULT_BATTERY_LIFETIME = 2;
	double batteryLifeTime;
	boolean hasWiFi;
	
	public PortableDevice(double batteryLifeTime, boolean hasWifi) {
		this.batteryLifeTime = batteryLifeTime;
		this.hasWiFi = hasWifi;
	}
	
	public PortableDevice() {
		batteryLifeTime = DEFAULT_BATTERY_LIFETIME;
		hasWiFi = false;
	}
	
	public void turnOn(boolean isParentalControlEnabled) {
		if (isParentalControlEnabled) {
			System.out.println("Turning on the portable device with parental control");
		} else {
			System.out.println("Turning on the portable device without parental control");
		}
	}
	
	@Override
	public void printCharacteristics() {
		System.out.println();
		System.out.println("Characteristics of the portable device: ");
		System.out.println("Battery lifetime: " + batteryLifeTime);
		System.out.println("Has WiFi module: " + hasWiFi);
	}
}
